package org.iabako.shared.querydefinition.columndefinition;

import org.iabako.client.tools.Messages;
import org.iabako.shared.querydefinition.dto.QueryResultValueType;

import java.io.Serializable;

/**
 * Created by jose on 23/03/14.
 */
public enum ServiceColumnEnum implements ColumnDefinition, Serializable {

    number("service.number", "result_table_service_number", "columnS columnleftalign smalltable", QueryResultValueType.STRING, 4000, false),
    name("service.name", "result_table_service_name", "columnL", QueryResultValueType.STRING, 6000, false),
    description("service.description", "result_table_service_description", "columnXL smalltable", QueryResultValueType.STRING, 15000, false),
    price("service.price", "result_table_service_total_price", "columnS columnrightalign", QueryResultValueType.DOUBLE, 4000, false),
    tax("service.taxPercent", "result_table_product_tax", "", QueryResultValueType.DOUBLE, 4000, true),

    //To filter with suggest field
    serviceId("service.id", null, null, null, 0, false),

    //default filter with user session
    serviceEnterprise("service.enterprise", null, null, null, 0, false);

    private String hqlDefinition;
    private String labelKey;
    private String className;
    private QueryResultValueType queryResultValueType;
    private int excelColumnWidth;
    private boolean onlyInExcelExport;

    ServiceColumnEnum(String hqlDefinition, String labelKey, String className, QueryResultValueType queryResultValueType, int excelColumnWidth, boolean onlyInExcelExport) {
        this.hqlDefinition = hqlDefinition;
        this.labelKey = labelKey;
        this.className = className;
        this.queryResultValueType = queryResultValueType;
        this.excelColumnWidth = excelColumnWidth;
        this.onlyInExcelExport = onlyInExcelExport;
    }

    public String getHqlDefinition() {
        return hqlDefinition;
    }

    public String getHqlJoin() {
        return null;
    }


    public String getLabel() {
        return Messages.getLabel(labelKey);
    }

    public String getLabelKey() {
        return labelKey;
    }

    public QueryResultValueType getQueryResultValueType() {
        return queryResultValueType;
    }

    public int getExcelColumnWidth() {
        return excelColumnWidth;
    }

    public String getClassName() {
        return className;
    }

    public String getIconClassName() {
        return null;
    }

    public boolean isOnlyInExcelExport() {
        return onlyInExcelExport;
    }

    public String getIconClassNameEmpty() {
        return null;
    }

    public String getTextEmpty() {
        return null;
    }

}
